import { defineStore } from 'pinia';
import { ThemeEnum } from '@/enums/styleEnum';
import { StorageEnum  } from '@/enums/storageEnum';
import { setLocalStorage } from '@/utils';

export const useThemeStore = defineStore('designStore', () => {
  // 主题
  const theme = ref(ThemeEnum.LIGHT);

  // 设置语言
  const setTheme = (value: ThemeEnum): void => {
    theme.value = value;
    setLocalStorage(StorageEnum.GO_DESIGN_STORE, value);
  };

  return {
    theme,
    setTheme,
  };
})